<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // () 单独捕获
      const r1 = /(\d\d):(\d\d)/g;
      const str = "11:23,12:30,13:40";
      console.log(str.match(r1));
      console.log([...str.matchAll(r1)]); //推荐
      console.log(Array.from(str.matchAll(r1)));
    </script>
  </body>
</html>
